<?php
/*
 * @Author: your name
 * @Date: 2022-01-08 17:48:34
 * @LastEditTime: 2022-01-11 17:54:10
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \www.wy.com\app\common\model\AdminUser.php
 */
declare(strict_types = 1);

namespace app\common\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class AdminUser extends Model
{
    // 通过用户名获取用户信息是否存在
    public function getUserInfoByUserName($username)
    {
        // 判断这个值是否存在
        if (empty($username)) {
            return false;
        }

        $where = [
            'username' => $username
        ];
        $result = $this->where($where)->find();
        return $result;
    }

    // 接收到数据进行更改
    public function UpdateAdminUserById($userId,$data)
    {
        $adminUser = $this->find($userId);
        $res = $adminUser->save($data);
        return $res;
    }
}
